package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.neuedu.dao.StorageDao;
import com.neuedu.model.Storage;
import com.neuedu.service.StorageService;

//配置一个spring的服务，把业务实现类交给spring进行管理，由spring完成依赖注入
@Service
public class StorageServiceImpl implements StorageService {

	//织入-依赖注入
	@Autowired
	private StorageDao StorageDao;
	
	public void setStorageDao(StorageDao storageDao) {
		this.StorageDao = storageDao;
	}

	@Override
	public int countStorage() {
		// TODO Auto-generated method stub
		return StorageDao.countStorage();
	}

	@Override
	public List<Storage> findAll(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return StorageDao.findAll(map);
	}

	@Override
	public int addStorage(Storage c) {
		// TODO Auto-generated method stub
		return StorageDao.addStorage(c);
	}

	@Override
	public int updateStorage(Storage c) {
		// TODO Auto-generated method stub
		return StorageDao.updateStorage(c);
	}

	@Override
	public int deleteStorage(int id) {
		// TODO Auto-generated method stub
		return StorageDao.deleteStorage(id);
	}

}
